// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

entd.onLoad =
function onLoad(manifest) {
  entd.pkcs11.setUserPin("111111");
  var slot1 = new entd.pkcs11.SlotObject("slot1");

  // Generate a keypair and valid CSR so that we write them to the TPM.
  slot1.generateKeyPair("9999");

  if (!("slot1" in entd.pkcs11.slots))
    return println("Expected to find entd.pkcs11.slots['slot1']");

  entd.pkcs11.remove("slot1");

  if ("slot1" in entd.pkcs11.slots)
    return println("Expected entd.pkcs11.slots['slot1'] to have been deleted");

  println("LOOKS OK");
}
